#version 320 es
#ifdef GL_ES
	precision highp float;
#endif
out vec4 FragColor;

in vec3 position;

uniform vec3 bottomLeft;
uniform float maxHeight;
uniform vec3 color;

void main()
{
	vec3 vectorP = position - bottomLeft;
	float f = dot(vectorP, vec3(0.0, 0.0, -1.0)) / maxHeight / 1.5;
	const vec3 white = vec3(1.0, 1.0, 1.0);
	FragColor = vec4(mix(color, white, f), 1.0);
}